package com.ruoyi.business.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.business.domain.IndicatorDetail;
import org.apache.ibatis.annotations.Delete;

/**
 * 指标明细Mapper接口
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
public interface IndicatorDetailMapper 
{
    /**
     * 查询指标明细
     * 
     * @param id 指标明细主键
     * @return 指标明细
     */
    public IndicatorDetail selectIndicatorDetailById(Long id);

    /**
     * 查询指标明细列表
     * 
     * @param indicatorDetail 指标明细
     * @return 指标明细集合
     */
    public List<IndicatorDetail> selectIndicatorDetailList(IndicatorDetail indicatorDetail);

    /**
     * 新增指标明细
     * 
     * @param indicatorDetail 指标明细
     * @return 结果
     */
    public int insertIndicatorDetail(IndicatorDetail indicatorDetail);

    /**
     * 修改指标明细
     * 
     * @param indicatorDetail 指标明细
     * @return 结果
     */
    public int updateIndicatorDetail(IndicatorDetail indicatorDetail);

    /**
     * 删除指标明细
     * 
     * @param id 指标明细主键
     * @return 结果
     */
    public int deleteIndicatorDetailById(Long id);

    /**
     * 批量删除指标明细
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteIndicatorDetailByIds(Long[] ids);


    @Delete("DELETE FROM t_indicator_Detail")
    void clearTable();

    @Delete("DELETE FROM t_indicator_Detail WHERE DATE_FORMAT(award_year, '%Y') = DATE_FORMAT(NOW(), '%Y')")
    void clearTableCurrent();

    @Delete("DELETE FROM t_indicator_Detail WHERE DATE_FORMAT(award_year, '%Y') = DATE_FORMAT(#{awd}, '%Y')")
    void clearTableYear(Date date);
}
